﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace NetSurveillance.WebApp.Filters
{
    [AttributeUsage(AttributeTargets.Property)]
    public class WhiteListAttribute : ValidationAttribute, IClientValidatable
    {
        //public string TypeName { get; set; }

        //public override bool IsValid(object value)
        //{
        //    if (TypeName.Length > 0 && value != null)
        //    {
        //        string contents = (string)value;
        //        switch (TypeName)
        //        {
        //            case "Domian":
        //            default:
        //                break;
        //        }
        //    }
        //}

        //private string[] SplitContents(string value)
        //{
        //    if (value.IndexOf("\r\n") > -1) {
        //        return value.Split("");
        //    }
        //}
        #region IClientValidatable 成员

        public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}